<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let originData = {
      "data": [
        {
          "UserName": "毕晓峰",
          "MobliePhone": "18822883556",
          "workphone": "18822883556",
          "NameCode": "BXF"
        },
        {
          "UserName": "毕晓峰2",
          "MobliePhone": "18822883556",
          "workphone": "18822883556",
          "NameCode": "BXF2"
        },
        {
          "UserName": "曾芳玲",
          "MobliePhone": "15576617134",
          "workphone": "15576617134",
          "NameCode": "CFL"
        },
        {
          "UserName": "傳概如",
          "MobliePhone": "13554786799",
          "workphone": "13554786799",
          "NameCode": "CGR"
        },
        {
          "UserName": "陈焕",
          "MobliePhone": "13691881219",
          "workphone": "0755-26620961",
          "NameCode": "CH"
        },
        {
          "UserName": "曹昊",
          "MobliePhone": "13682476778",
          "workphone": "13682476778",
          "NameCode": "CH"
        },
        {
          "UserName": "程华滚",
          "MobliePhone": "13692160772",
          "workphone": "13692160772",
          "NameCode": "CHG"
        },
        {
          "UserName": "陈金",
          "MobliePhone": "13530994737",
          "workphone": "86235078",
          "NameCode": "CJ"
        },
        {
          "UserName": "岑健",
          "MobliePhone": "‭13689571877",
          "workphone": "‭13689571877",
          "NameCode": "CJ"
        },
        {
          "UserName": "陈金2",
          "MobliePhone": "13530994737",
          "workphone": "13530994737",
          "NameCode": "CJ2"
        },
        {
          "UserName": "程金滚",
          "MobliePhone": "13684820063",
          "workphone": "13684820063",
          "NameCode": "CJG"
        },
        {
          "UserName": "陈建文",
          "MobliePhone": "13714089477",
          "workphone": "13714089477",
          "NameCode": "CJW"
        },
        {
          "UserName": "陈凯",
          "MobliePhone": "15571381771",
          "workphone": "15571381771",
          "NameCode": "CK"
        },
        {
          "UserName": "程亮",
          "MobliePhone": "13715311641",
          "workphone": "0755-26620961",
          "NameCode": "CL"
        },
        {
          "UserName": "曾琦",
          "MobliePhone": "17612752437",
          "workphone": "17612752437",
          "NameCode": "CQ"
        },
        {
          "UserName": "岑文革",
          "MobliePhone": "13824398158",
          "workphone": "0755-26620961",
          "NameCode": "CWG"
        },
        {
          "UserName": "陈婉希",
          "MobliePhone": "15217151584",
          "workphone": "15217151584",
          "NameCode": "CWX"
        },
        {
          "UserName": "陈洋",
          "MobliePhone": "13528801005",
          "workphone": "0755-26620961",
          "NameCode": "CX"
        },
        {
          "UserName": "岑细兵",
          "MobliePhone": "13670076612",
          "workphone": "13670076612",
          "NameCode": "CXB"
        },
        {
          "UserName": "程旭东",
          "MobliePhone": "18682483175",
          "workphone": "18682483175",
          "NameCode": "CXD"
        },
        {
          "UserName": "岑先丰",
          "MobliePhone": "13316999089",
          "workphone": "86235078",
          "NameCode": "CXF"
        },
        {
          "UserName": "岑小平",
          "MobliePhone": "13652397055",
          "workphone": "0755-26620961",
          "NameCode": "CXP"
        },
        {
          "UserName": "岑小平一",
          "MobliePhone": "13652397055",
          "workphone": "86235078",
          "NameCode": "CXPY"
        },
        {
          "UserName": "陈雅",
          "MobliePhone": "18319658038",
          "workphone": "18319658038",
          "NameCode": "CY"
        },
        {
          "UserName": "陈燕平",
          "MobliePhone": "15012731219",
          "workphone": "15012731219",
          "NameCode": "CYP"
        },
        {
          "UserName": "陈盈盈",
          "MobliePhone": "18664327140",
          "workphone": "18664327140",
          "NameCode": "CYY"
        },
        {
          "UserName": "常主",
          "MobliePhone": "18820328363",
          "workphone": "18820328363",
          "NameCode": "CZ"
        },
        {
          "UserName": "曾卓林",
          "MobliePhone": "13128900967",
          "workphone": "13128900967",
          "NameCode": "CZL"
        },
        {
          "UserName": "邓敏",
          "MobliePhone": "13242001927",
          "workphone": "0755-26620961",
          "NameCode": "DM"
        },
        {
          "UserName": "董伟",
          "MobliePhone": "18589090425",
          "workphone": "18589090425",
          "NameCode": "DW"
        },
        {
          "UserName": "董翔",
          "MobliePhone": "18596788360",
          "workphone": "18596788360",
          "NameCode": "DX"
        },
        {
          "UserName": "付建浪",
          "MobliePhone": "18720184646",
          "workphone": "18720184646",
          "NameCode": "FJL"
        },
        {
          "UserName": "冯梦琪",
          "MobliePhone": "15118813371",
          "workphone": "15118813371",
          "NameCode": "FMQ"
        },
        {
          "UserName": "付姚",
          "MobliePhone": "13631467961",
          "workphone": "13631467961",
          "NameCode": "FY"
        },
        {
          "UserName": "挂靠",
          "MobliePhone": "13430445987",
          "workphone": "26620961",
          "NameCode": "GK"
        },
        {
          "UserName": "胡从",
          "MobliePhone": "13339961689",
          "workphone": "13339961689",
          "NameCode": "HC"
        },
        {
          "UserName": "许翠云",
          "MobliePhone": "13424418622",
          "workphone": "13424418622",
          "NameCode": "HCY"
        },
        {
          "UserName": "黄国华",
          "MobliePhone": "18576775363",
          "workphone": "18576775363",
          "NameCode": "HGH"
        },
        {
          "UserName": "胡金兵",
          "MobliePhone": "18676723746",
          "workphone": "26991051",
          "NameCode": "HJB"
        },
        {
          "UserName": "贺晶晶",
          "MobliePhone": "15678695674",
          "workphone": "15678695674",
          "NameCode": "HJJ"
        },
        {
          "UserName": "胡奎",
          "MobliePhone": "13410550074",
          "workphone": "13410550074",
          "NameCode": "HK"
        },
        {
          "UserName": "胡良松",
          "MobliePhone": "13480906772",
          "workphone": "26620961",
          "NameCode": "HLS"
        },
        {
          "UserName": "许蔚",
          "MobliePhone": "13728914458",
          "workphone": "13728914458",
          "NameCode": "HW"
        },
        {
          "UserName": "姜红辉",
          "MobliePhone": "18928487956",
          "workphone": "86235078",
          "NameCode": "JGH"
        },
        {
          "UserName": "蒋和雁",
          "MobliePhone": "15986690058",
          "workphone": "0755-26620961",
          "NameCode": "JHY"
        },
        {
          "UserName": "蒋九大",
          "MobliePhone": "13509687258",
          "workphone": "13509687258",
          "NameCode": "JJD"
        },
        {
          "UserName": "骆敏安",
          "MobliePhone": "18682006962",
          "workphone": "18682006962",
          "NameCode": "JMA"
        },
        {
          "UserName": "骆梦甜",
          "MobliePhone": "17612772624",
          "workphone": "17612772624",
          "NameCode": "JMT"
        },
        {
          "UserName": "冀倩倩",
          "MobliePhone": "18610012696",
          "workphone": "26991051",
          "NameCode": "JQQ"
        },
        {
          "UserName": "开发人员",
          "MobliePhone": "18319991785",
          "workphone": "12369531",
          "NameCode": "KFRY"
        },
        {
          "UserName": "刘超平",
          "MobliePhone": "13422931059",
          "workphone": "13422931059",
          "NameCode": "LCP"
        },
        {
          "UserName": "刘发明",
          "MobliePhone": "13715167464",
          "workphone": "13715167464",
          "NameCode": "LFM"
        },
        {
          "UserName": "李官键",
          "MobliePhone": "18078067481",
          "workphone": "18078067481",
          "NameCode": "LGJ"
        },
        {
          "UserName": "吕华军",
          "MobliePhone": "13927496586",
          "workphone": "13927496586",
          "NameCode": "LHJ"
        },
        {
          "UserName": "李敬宁",
          "MobliePhone": "18649172366",
          "workphone": "18649172366",
          "NameCode": "LJN"
        },
        {
          "UserName": "梁钧雯",
          "MobliePhone": "18318530759",
          "workphone": "18318530759",
          "NameCode": "LJW"
        },
        {
          "UserName": "李康",
          "MobliePhone": "13576716363",
          "workphone": "26620961",
          "NameCode": "LK"
        },
        {
          "UserName": "刘路颖",
          "MobliePhone": "18404221253",
          "workphone": "18404221253",
          "NameCode": "LLY"
        },
        {
          "UserName": "罗泉",
          "MobliePhone": "13058123123",
          "workphone": "13058123123",
          "NameCode": "LQ"
        },
        {
          "UserName": "李秋林",
          "MobliePhone": "13530599009",
          "workphone": "13530599009",
          "NameCode": "LQL"
        },
        {
          "UserName": "李树盛",
          "MobliePhone": "15814470798",
          "workphone": "15814470798",
          "NameCode": "LSC"
        },
        {
          "UserName": "龙晓春",
          "MobliePhone": "13823703731",
          "workphone": "86235078",
          "NameCode": "LXC"
        },
        {
          "UserName": "李锡甫",
          "MobliePhone": "13827487012",
          "workphone": "13827487012",
          "NameCode": "LXF"
        },
        {
          "UserName": "乐习鹏",
          "MobliePhone": "18820929246",
          "workphone": "18820929246",
          "NameCode": "LXP"
        },
        {
          "UserName": "李小莹",
          "MobliePhone": "13246600507",
          "workphone": "13246600507",
          "NameCode": "LXY"
        },
        {
          "UserName": "林云龙",
          "MobliePhone": "13510376118",
          "workphone": "13510376118",
          "NameCode": "LYL"
        },
        {
          "UserName": "刘亚明",
          "MobliePhone": "18855997995",
          "workphone": "18855997995",
          "NameCode": "LYM"
        },
        {
          "UserName": "麦善福",
          "MobliePhone": "15118010935",
          "workphone": "15118010935",
          "NameCode": "MSF"
        },
        {
          "UserName": "马小建",
          "MobliePhone": "13632772738",
          "workphone": "0755-26991051",
          "NameCode": "MXJ"
        },
        {
          "UserName": "欧阳少卿",
          "MobliePhone": "18979209791",
          "workphone": "18979209791",
          "NameCode": "OYSQ"
        },
        {
          "UserName": "彭方平",
          "MobliePhone": "18823319565",
          "workphone": "18823319565",
          "NameCode": "PFP"
        },
        {
          "UserName": "邱成计",
          "MobliePhone": "13728776231",
          "workphone": "13728776231",
          "NameCode": "QCJ"
        },
        {
          "UserName": "钱梦亦",
          "MobliePhone": "17682301445",
          "workphone": "17682301445",
          "NameCode": "QMY"
        },
        {
          "UserName": "邱志强",
          "MobliePhone": "18813382937",
          "workphone": "18813382937",
          "NameCode": "QZJ"
        },
        {
          "UserName": "饶玲",
          "MobliePhone": "18823828680",
          "workphone": "18823828680",
          "NameCode": "RL"
        },
        {
          "UserName": "汤高福",
          "MobliePhone": "13510327408",
          "workphone": "13510327408",
          "NameCode": "SGF"
        },
        {
          "UserName": "邵诗恩",
          "MobliePhone": "13714552060",
          "workphone": "0755-25110107",
          "NameCode": "SSE"
        },
        {
          "UserName": "俞夏纯",
          "MobliePhone": "13713608913",
          "workphone": "13713608913",
          "NameCode": "SXC"
        },
        {
          "UserName": "苏雄明",
          "MobliePhone": "13652426362",
          "workphone": "13652426362",
          "NameCode": "SXM"
        },
        {
          "UserName": "汤正国",
          "MobliePhone": "13714249977",
          "workphone": "13714249977",
          "NameCode": "SZG"
        },
        {
          "UserName": "唐艳飞",
          "MobliePhone": "13430445987",
          "workphone": "13430445987",
          "NameCode": "TYF"
        },
        {
          "UserName": "唐紫蓓",
          "MobliePhone": "18682036530",
          "workphone": "86235078",
          "NameCode": "TZB"
        },
        {
          "UserName": "谭泽溪",
          "MobliePhone": "18476091204",
          "workphone": "18476091204",
          "NameCode": "TZX"
        },
        {
          "UserName": "王冬志",
          "MobliePhone": "13410145656",
          "workphone": "13410145656",
          "NameCode": "WDZ"
        },
        {
          "UserName": "王桂强",
          "MobliePhone": "13927476055",
          "workphone": "86235078",
          "NameCode": "WGJ"
        },
        {
          "UserName": "王鸿俊",
          "MobliePhone": "13715331506",
          "workphone": "13715331506",
          "NameCode": "WHJ"
        },
        {
          "UserName": "王乐",
          "MobliePhone": "15986602982",
          "workphone": "15986602982",
          "NameCode": "WL"
        },
        {
          "UserName": "魏文斌",
          "MobliePhone": "18211566095",
          "workphone": "0755-26620961",
          "NameCode": "WWB"
        },
        {
          "UserName": "汪显宏",
          "MobliePhone": "13267181225",
          "workphone": "13267181225",
          "NameCode": "WXH"
        },
        {
          "UserName": "王小勇",
          "MobliePhone": "13692195675",
          "workphone": "13692195675",
          "NameCode": "WXY"
        },
        {
          "UserName": "吴瑶",
          "MobliePhone": "13925195305",
          "workphone": "26991051",
          "NameCode": "WY"
        },
        {
          "UserName": "吴志喜",
          "MobliePhone": "13128897928",
          "workphone": "13128897928",
          "NameCode": "WZX"
        },
        {
          "UserName": "夏东洋",
          "MobliePhone": "18688942253",
          "workphone": "18688942253",
          "NameCode": "XDX"
        },
        {
          "UserName": "徐杰",
          "MobliePhone": "13713706669",
          "workphone": "13713706669",
          "NameCode": "XJ"
        },
        {
          "UserName": "肖琳",
          "MobliePhone": "13670022003",
          "workphone": "13670022003",
          "NameCode": "XL"
        },
        {
          "UserName": "徐文昌",
          "MobliePhone": "13030294392",
          "workphone": "13030294392",
          "NameCode": "XWC"
        },
        {
          "UserName": "肖小毛",
          "MobliePhone": "13613000834",
          "workphone": "13613000834",
          "NameCode": "XXM"
        },
        {
          "UserName": "谢晓雪",
          "MobliePhone": "15728239952",
          "workphone": "15728239952",
          "NameCode": "XXX"
        },
        {
          "UserName": "游安东",
          "MobliePhone": "13418853806",
          "workphone": "0755-26620961",
          "NameCode": "YAD"
        },
        {
          "UserName": "袁军",
          "MobliePhone": "13510642890",
          "workphone": "13510642890",
          "NameCode": "YJ"
        },
        {
          "UserName": "叶建崇",
          "MobliePhone": "15012955069",
          "workphone": "15012955069",
          "NameCode": "YJC"
        },
        {
          "UserName": "袁腊福",
          "MobliePhone": "‭13632773637‬",
          "workphone": "‭13632773637‬",
          "NameCode": "YLF"
        },
        {
          "UserName": "游利民",
          "MobliePhone": "13480915486",
          "workphone": "86235078",
          "NameCode": "YLM"
        },
        {
          "UserName": "游新林",
          "MobliePhone": "13530131777",
          "workphone": "13530131777",
          "NameCode": "YXL"
        },
        {
          "UserName": "游益坤",
          "MobliePhone": "13686404932",
          "workphone": "13686404932",
          "NameCode": "YYK"
        },
        {
          "UserName": "杨志林",
          "MobliePhone": "13554315547",
          "workphone": "13554315547",
          "NameCode": "YZL"
        },
        {
          "UserName": "叶周转",
          "MobliePhone": "17620342340",
          "workphone": "17620342340",
          "NameCode": "YZZ"
        },
        {
          "UserName": "郑安妮",
          "MobliePhone": "14718288867",
          "workphone": "14718288867",
          "NameCode": "ZAN"
        },
        {
          "UserName": "张风雷",
          "MobliePhone": "15288664370",
          "workphone": "0755-26620961",
          "NameCode": "ZFL"
        },
        {
          "UserName": "赵婧栋",
          "MobliePhone": "26620961",
          "workphone": "26620961",
          "NameCode": "ZJD"
        },
        {
          "UserName": "张建平",
          "MobliePhone": "18926786579",
          "workphone": "18926786579",
          "NameCode": "ZJP"
        },
        {
          "UserName": "张莉",
          "MobliePhone": "13417380286",
          "workphone": "13417380286",
          "NameCode": "ZL"
        },
        {
          "UserName": "章龙",
          "MobliePhone": "18216401238",
          "workphone": "18216401238",
          "NameCode": "ZL"
        },
        {
          "UserName": "周礼鲜",
          "MobliePhone": "13973404034",
          "workphone": "13973404034",
          "NameCode": "ZLX"
        },
        {
          "UserName": "张倩",
          "MobliePhone": "18979794695",
          "workphone": "18979794695",
          "NameCode": "ZQ"
        },
        {
          "UserName": "张伟",
          "MobliePhone": "18680395543",
          "workphone": "18680395543",
          "NameCode": "ZW"
        },
        {
          "UserName": "张威",
          "MobliePhone": "13802264039",
          "workphone": "13802264039",
          "NameCode": "ZW"
        },
        {
          "UserName": "张伟3",
          "MobliePhone": "18680395543",
          "workphone": "18680395543",
          "NameCode": "ZW3"
        },
        {
          "UserName": "钟文海",
          "MobliePhone": "18279779998",
          "workphone": "26620961",
          "NameCode": "ZWH"
        },
        {
          "UserName": "钟文汉",
          "MobliePhone": "13411201204",
          "workphone": "13411201204",
          "NameCode": "ZWH"
        },
        {
          "UserName": "张旭",
          "MobliePhone": "15914133137",
          "workphone": "0755-26620961",
          "NameCode": "ZX"
        },
        {
          "UserName": "周意",
          "MobliePhone": "18171730077",
          "workphone": "18171730077",
          "NameCode": "ZY"
        }
      ],
      "Total": 122
    }

    function wrapIndexList (dataArr) {
      return dataArr.reduce((pre, next) => {
        let firstLetter = next.NameCode.substr(0, 1)
        firstLetter.toUpperCase()
        if (pre[firstLetter]) {
          pre[firstLetter].push(next)
        } else {
          pre[firstLetter] = [next]
        }
        return pre
      }, {})
    }
    const returnData = wrapIndexList(originData.data)
    let sortedKeys = Object.keys(returnData).sort((a, b) => a - b)
    const indexList = sortedKeys.map(c => {
      let data = returnData[c]
      return {
        letter: c,
        data
      }
    })
    console.log(indexList)
  </script>
</body>
</html>